﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Edituser.aspx.cs" Inherits="admin_funcion_Edituser" %>

<%@ Register src="../usercontrol/category.ascx" tagname="category" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  <script type="text/javascript">
        function confirmdelete()
        {  if (window.confirm("Bạn có muốn xóa đơn hàng này không ?"))
            {return true;}return false;
        }
        function confirmupdate()
        {  if (window.confirm("Bạn có muốn cập nhật thông tin về đơn hàng này không ?"))
            {return true;}return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceLeft" Runat="Server">

    <uc1:category ID="category1" runat="server" />

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div  class="portlet x9">
                    <div class="portlet-header"><h4>Thông tin thành viên</h4></div>
                    <div class="portlet-content">
        <h3>Thông tin khách hàng</h3>
                         <div class="adrow">
                            <div class="adlrow">(*)bắt buộc</div>
                            <div class="adrrow">
                                <asp:Label ID="Lthongbao" runat="server" Text=""></asp:Label>
                            </div>
                         </div>
                         <div class="adrow">
                            <div class="adlrow">Họ tên:</div>
                            <div class="adrrow">
                                <asp:TextBox ID="txthoten" runat="server" Width="200px"></asp:TextBox> 
                                <asp:RequiredFieldValidator ID="Rfhoten" ControlToValidate="txthoten" runat="server" ErrorMessage="(*)"></asp:RequiredFieldValidator>     
                            </div>
                        </div>
                         <div class="adrow">
                            <div class="adlrow">Địa chỉ:</div>
                            <div class="adrrow">
                                <asp:TextBox ID="txtdiachi" runat="server" Width="300px"></asp:TextBox>      
                                <asp:RequiredFieldValidator ID="Rfdiachi" runat="server" ErrorMessage="(*)" 
                                    ControlToValidate="txtdiachi"></asp:RequiredFieldValidator>
                           </div>
                        
                        </div>
                         <div class="adrow">
                            <div class="adlrow">Điện thoại:</div>
                            <div class="adrrow">
                                <asp:TextBox ID="txtdienthoai" runat="server" Width="200px" MaxLength="12"></asp:TextBox> 
                                <asp:RequiredFieldValidator ID="Rfdienthoai" runat="server" ErrorMessage="(*)" 
                                    ControlToValidate="txtdienthoai"></asp:RequiredFieldValidator>   
                                       
                            </div>
                        
                        </div>
                         <div class="adrow">
                            <div class="adlrow">Email:</div>
                            <div class="adrrow">
                                <asp:TextBox ID="txtemail" runat="server" Width="250px"></asp:TextBox>   
                                <asp:RegularExpressionValidator ID="rglemail" runat="server" 
                                    ErrorMessage="Email không đúng" ControlToValidate="txtemail" 
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                                    Display="Dynamic"></asp:RegularExpressionValidator>            
                            </div>
                        
                        </div>
                         <div class="adrow">
                            <div class="adlrow">Thành phố:</div>
                            <div class="adrrow">
                                <asp:TextBox ID="txtthanhpho" runat="server" Width="200px"></asp:TextBox> 
                                 <asp:RequiredFieldValidator ID="Rfthanhpho" runat="server" ErrorMessage="(*)" 
                                    ControlToValidate="txtthanhpho"></asp:RequiredFieldValidator>              
                            </div>
                            </div>
                         <div class="adrow">
                            <div class="adlrow">Mã xác nhận:</div>
                            <div class="adrrow" style="float: left">
                                <div style="float: left">
                                    <asp:TextBox ID="txtcapcha" runat="server" Width="100px"></asp:TextBox>
                                </div>     
                                <div class ="capcha" style=" background:#e0e0e0; width: 50px; height: 12px; margin:2px; float: left; padding:5px;">
                                    <asp:Literal ID="macapcha" runat="server"></asp:Literal>
                                </div>         
                            </div>
                        
                        </div>
                         <div class="adrow ">
                            <div class="adlrow"></div>
                            <div class="adrrow" style=" text-align:center; padding-left: 70px">
                                <asp:Button ID="btnCapnhat" UseSubmitBehavior="false" CssClass="btn btn-person" runat="server" 
                                    Text="Cập nhật" onclick="btnCapnhat_Click" 
                                     />
                               
                            </div>
                        
                        </div>
                        
        <h3>Danh sách đơn đặt hàng</h3>
         <div class="pcartrow">
            <asp:Label ID="Lbmessage" Visible="true" runat="server" Text=""></asp:Label></div>
             <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    
                    <asp:ListView ID="Lproducts" runat="server" 
                        onitemdeleting="Lproducts_ItemDeleting" 
                        onitemupdating="Lproducts_ItemUpdating">
                    
                    <LayoutTemplate>
                     <div class ="pcartborder">
                       
                        <div class ="pcartrow header" style ="font-weight: bold;">
                            <div class ="pcartitemno">STT</div>
                            <div class ="prcol">Mã đơn hàng</div>
                            <div class ="prcol">Mã Thành viên</div>
                            <div class = "prcol">Ngày Đặt hàng</div>
                            <div class = "prcol">Thành Tiền</div>
                            <div class="prcol">Trạng thái</div>
                        </div> 
                        
                                <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
                        
                                <div class="pager">
                <asp:Literal ID="PageInfo" runat="server" >Trang: </asp:Literal>
              <asp:DataPager ID="pager" runat="server" PagedControlID="Lproducts" PageSize="10">
                    <Fields>
                        <asp:NumericPagerField CurrentPageLabelCssClass="pager_current" ButtonCount="3" RenderNonBreakingSpacesBetweenControls="false"
                            NextPageText=".." PreviousPageText=".." />
                    </Fields>
                </asp:DataPager>
            </div>
                    
                    </div>
                    </LayoutTemplate>
                    <EmptyItemTemplate>
                            <h4>Thành viên này chưa có đơn đặt hàng nào</h4>
                    </EmptyItemTemplate>
                    <EmptyDataTemplate> <h4>Thành viên này chưa có đơn đặt hàng nào</h4></EmptyDataTemplate>
                    <ItemTemplate>
                        <div class="pcartrow">
                            <div class ="pcartitemno">
                                   <%# Container.DataItemIndex + 1 %>
                                </div>
                              
                                <asp:HiddenField ID="hdid" runat="server" Visible = "false"  Value = '<%#Eval("Order_Id")%>' />
                                <div class ="prcol">
                                   <%#Eval("Order_Id")%>
                                </div>
                                <div class ="prcol">
                                   <%#Eval("Members_Id")%>
                                </div>
                                <div class = "prcol">
                                      <%#Eval("Order_Date","{0:d}")%>
                                </div>
                                 <div class = "prcol">
                                      <%#Eval("Order_Total","{0:0,0}")+" "%>vnđ
                                </div>
                                 <div class = "prcol">
                                    <asp:CheckBox ID="IsActive" runat="server"  Checked='<%# Eval("IsActive") %>' />
                                </div>
                                 <div class="pcardsubmit">
                                     <a href='<%# "http://localhost:2011/didong/admin/order/orderdetails.aspx?Id=" + Eval("Order_Id")%>' title= '<%#"Sửa chi tiết [ " + Eval("Order_Id") + " ]"%>'> <img src ="http://localhost:2011/didong/images/design/acp_edit.gif" alt = "Sửa" style ="width: 12px ;height: 12px ;border: none; padding-top: 2px;" /> </a>
                                </div>
                                  <div class = "pcardsubmit">
                                    <asp:ImageButton ID=  "btnSave"  CommandName = "Update"  runat="server" OnClientClick = "return confirmupdate()" ImageUrl ="http://localhost:2011/didong/images/design/save_on.gif"  AlternateText = "save"  Width = "15" Height ="15"  ToolTip = "Lưu thay đổi"/>
                                 </div>
                                  <div class="pcartitemno">
                                    <asp:ImageButton ID=  "btnDelete"   CommandName = "Delete"  runat="server" OnClientClick = "return confirmdelete()" ImageUrl ="http://localhost:2011/didong/images/design/delete_on.gif"  AlternateText = "Del"  Width = "15" Height ="18"  ToolTip = "Xóa sản phẩm"/> 
                                  </div>
                                
                        
                        </div>
                    </ItemTemplate>
                    </asp:ListView>
            
                </ContentTemplate>
             </asp:UpdatePanel>
               </div>
 </div>
</asp:Content>

